package com.mayikt.controller;

import com.mayikt.entity.UserEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Map;

/**
 * @author: BuMingBo
 * @ClassName: MyThymeleafController
 * @create: 2022-05-06 22:28
 * @Description: Thymeleaf控制类
 * Version: 1.0
 */
@Controller
public class MyThymeleafController {
    @RequestMapping("/myThymeleaf")
    public String myThymeleaf(Map<String, Object> result, HttpServletRequest request){
        result.put("user", new UserEntity("bmb", 22));
        ArrayList<UserEntity> userEntities = new ArrayList<>();
        userEntities.add(new UserEntity( "mayikt1", 22));
        userEntities.add(new UserEntity( "mayikt2", 22));
        userEntities.add(new UserEntity( "mayikt3", 22));
        result.put("userList",userEntities);
    return "myThymeleaf";

    }
}
